C# int to byte[]
Posted
by Petoj
on Stack Overflow
See other posts from Stack Overflow
or by Petoj
Published on 2009-08-23T16:22:09Z
Indexed on
2010/03/29
13:13 UTC
Read the original article
Hit count: 393
If I need to convert an int
to byte[]
I could use Bitconvert.GetBytes()
.
But if I should follow this:
An XDR signed integer is a 32-bit datum that encodes an integer in the range [-2147483648,2147483647]. The integer is represented in two's complement notation. The most and least significant bytes are 0 and 3, respectively. Integers are declared as follows:
Taken from RFC1014 3.2.
What method should I use then if there is no method to do this? How would it look like if you write your own?
I don't understand the text 100% so I can't implement it on my own.
© Stack Overflow or respective owner